package tabdulin.sms;

/**
 * @author Talgat Abdulin
 *
 */
@SuppressWarnings("serial")
public class InvalidSmsException extends Exception {
    private int errorCode = Sms.UNKNOWN_ERROR;

    public InvalidSmsException(int errorCode) {
        this.errorCode = errorCode;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public String getMessage() {
        switch (errorCode) {
        case Sms.CAPTCHA_CODE_ERROR:
            return "Error! Incorrect captchas code!";
        case Sms.NUMBER_ERROR:
            return "Error! Incorrect phone number!";
        case Sms.TOO_LONG_MESSAGE_ERROR:
            return "Error! Too long message!";
        default:
            return "Something weird happened";
        }
    }
}
